<?php

if(!defined('FYSCU_ROOT')){
	exit('非法访问');
}

class mgr extends action_base{
		
	public function action_index(){
		
		$this->render('mgr',array('project'=>PROJECT_NAME));
	}
	/**
	 * 增加一条词条
	 */
	public function action_add()
	{
		if(isset($_POST['submit'])){
			$data = array();
			$data['dateline'] = time();
			$data['word'] = $_POST['word'];
			$data['des'] = $_POST['des'];
			$data['example'] = $_POST['example'];
			$newid = FYDB::insert('kp_word_main', $data);
			if($newid){
				$p = array();
				$p['fid'] = $newid;
				$p_id = FYDB::insert('kp_word_p', $p);
			}
		}
	}
	
	
	protected function beforeAction()
	{
		if(!$this->auth())die('auth error');
	}
	/**
	 * 检测访问权限
	 * @return boolean
	 */
	private function auth()
	{
		
			return true;
		
	}
}
?>